import request from '@/utils/request'
// import { getToken } from '@/utils/storage'

// export const getArticleApi = (current, pageSize, sorter) => {
//   return request({
//     url: 'interview/query',
//     method: 'get',
//     params: {
//       current,
//       pageSize,
//       sorter
//     }
//   })
// }

export const getArticleApi = (current, pageSize, sorter) => {
  return request({
    url: 'interview/query',
    method: 'get',
    params: {
      current,
      pageSize,
      sorter
    }
    // headers: {
    //   Authorization: 'Bearer ' + getToken()
    // }
  })
}
// 错误
// export const getCollectApi = (current, pageSize, sorter) => {
//   return request.get({
//     url: 'interview/query',
//     method: 'get',
//     params: {
//       current,
//       pageSize,
//       sorter
//     }
//   })
// }

export const getArticleDetail = (id) => {
  return request.get('interview/show', {
    params: {
      id
    }
  })
}
export const getUpdataLikeApi = (id) => {
  return request({
    url: 'interview/opt',
    method: 'post',
    data: {
      id,
      optType: 1
    }
  })
}
export const getUpdataCollectApi = (id) => {
  return request({
    url: 'interview/opt',
    method: 'post',
    data: {
      id,
      optType: 2
    }
  })
}
//

export const getCollectApi = (optType, pageSize, page) => {
  return request({
    url: 'interview/opt/list',
    method: 'get',
    params: {
      optType,
      pageSize,
      page
    }
  })
}
